package cn.source.event.service.impl;

import java.util.List;

import cn.source.common.utils.SecurityUtils;
import cn.source.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.source.event.mapper.DbEventMapper;
import cn.source.event.domain.DbEvent;
import cn.source.event.service.IDbEventService;

/**
 * eventService业务层处理
 * 
 * @author sourcebyte.vip
 * @date 2025-06-14
 */
@Service
public class DbEventServiceImpl implements IDbEventService 
{
    @Autowired
    private DbEventMapper dbEventMapper;

    /**
     * 查询event
     * 
     * @param tdguid event主键
     * @return event
     */
    @Override
    public DbEvent selectDbEventByTdguid(String tdguid)
    {
        return dbEventMapper.selectDbEventByTdguid(tdguid);
    }

    /**
     * 查询event列表
     * 
     * @param dbEvent event
     * @return event
     */
    @Override
    public List<DbEvent> selectDbEventList(DbEvent dbEvent)
    {
        return dbEventMapper.selectDbEventList(dbEvent);
    }

    /**
     * 新增event
     * 
     * @param dbEvent event
     * @return 结果
     */
    @Override
    public int insertDbEvent(DbEvent dbEvent)
    {
        dbEvent.setId(IdUtils.randomUUID());
        return dbEventMapper.insertDbEvent(dbEvent);
    }

    /**
     * 修改event
     * 
     * @param dbEvent event
     * @return 结果
     */
    @Override
    public int updateDbEvent(DbEvent dbEvent)
    {
        return dbEventMapper.updateDbEvent(dbEvent);
    }

    /**
     * 批量删除event
     * 
     * @param tdguids 需要删除的event主键
     * @return 结果
     */
    @Override
    public int deleteDbEventByTdguids(String[] tdguids)
    {
        return dbEventMapper.deleteDbEventByTdguids(tdguids);
    }

    /**
     * 删除event信息
     * 
     * @param tdguid event主键
     * @return 结果
     */
    @Override
    public int deleteDbEventByTdguid(String tdguid)
    {
        return dbEventMapper.deleteDbEventByTdguid(tdguid);
    }
}
